<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
include ("../../include/image_slider.php");
include ("../../include/function.php");
include ("../../include/dbFunctions.php");

if (isset($_SESSION['school_id'])) {
    $rep_id = $_SESSION['school_id'];
    $program_id = $_POST['program_id'];
    $no_class = $_POST['no_class'];
    $class_level = $_POST['class_level'];
    $no_session = $_POST['session'];

}
?>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Junior Achievement Singapore</title>
        <style type="text/css">
            @import "../../media/css/jquery-ui-1.8.13.custom.css";
            /* css for formToWizard Plugin */

            #main { width:100%; margin: 0px auto; border:solid 1px #b2b3b5; -moz-border-radius:10px; padding:20px; background-color:#f6f6f6;}

            fieldset { border:none; width:320px;}
            legend { font-size:12px; margin:0px; padding:10px 0px; color:#666666; font-weight:bold;}
            label { display:block; margin:15px 0 5px; font-size:12px}
            .prev { float:left; background: url(../../media/images/forms/form_back.gif) no-repeat; height:30px; width: 80px; cursor: pointer; margin: 5px 0px 0px 0px;}
            .next { float:right; background: url(../../media/images/forms/form_next.gif) no-repeat; height:30px; width: 80px; cursor: pointer; margin: 5px 0px 0px 0px;}
            #steps { list-style:none; width:100%; overflow:hidden; margin:0px; padding:0px;}
            #steps li {font-size:24px; float:left; padding:10px; color:#b0b1b3;}
            #steps li span {font-size:12px; display:block;}
            #steps li.current { color:#000;}
            #makeWizard { background-color:#b0232a; color:#fff; padding:5px 10px; text-decoration:none; font-size:18px;}
            #makeWizard:hover { background-color:#000;}

        </style>
        <link href="../../media/css/styles.css" rel="stylesheet" type="text/css" />
        <link href="../../media/css/jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css" />

        <script type="text/javascript" language="javascript" src="../../media/js/jquery/jquery-1.6.1.min.js"></script>
        <script type="text/javascript" src="../../media/js/jqueryUI/jquery-ui-1.8.13.custom.js"></script>
        <script type="text/javascript" src="../../media/js/jquery/image_slider.js"></script>
        <!-- Custom jquery scripts -->

        <script type="text/javascript" language="javascript" src="../../media/js/jquery/jquery.validate.min.js"></script>
        <script type="text/javascript" src="../../media/js/jquery/validator_rules.js"></script>

        <script type="text/javascript" src="../../media/js/jqueryUI/jquery-ui-timepicker-addon.js"></script>
        
        <script src="../../media/js/jquery/jquery.maskedinput-1.3.js" type="text/javascript"></script>

        <script type="text/javascript">
            var no = "<?= $no_session ?>";
                var i=0;
                
                
                
            $(document).ready(function(){
               
                $("#eventRegistration").validate({
                  
                });
                // date picker for choosing date
                $(".date").datepicker({
                    changeMonth:true,
                    minDate: 0
                });
          

            }
            
        )
            jQuery(function($){   $(".time").mask("99:99");});
            
            
            
        </script>
    </head>
    <body>
        <script>
            var timeout    = 500;
            var closetimer = 0;
            var ddmenuitem = 0;

            function jsddm_open()
            {  jsddm_canceltimer();
                jsddm_close();
                ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

            function jsddm_close()
            {  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

            function jsddm_timer()
            {  closetimer = window.setTimeout(jsddm_close, timeout);}

            function jsddm_canceltimer()
            {  if(closetimer)
                {  window.clearTimeout(closetimer);
                    closetimer = null;}}

            $(document).ready(function()
            {  $('#navigation > li').bind('mouseover', jsddm_open)
                $('#navigation > li').bind('mouseout',  jsddm_timer)});

            document.onclick = jsddm_close;

        </script>
        <!-- End choose date and time script -->
        <div id="container"><!--CONTAINER STARTS-->
            <div id="navigation">
                <li><a href="../../include/home/homepage.php">HOME</a></li>
                <li><a href="../../include/home/contact.php">CONTACT</a></li>
                <li><a href="http://ja.org.sg/">ABOUT JA SINGAPORE</a></li>
                <li><a href="http://jascheduling.lefora.com/">FEEDBACK</a></li>
                <li><a href="../../guide/guide_menu.php">HELP</a></li>

            </div>

            <div id="title"><!--TITLE STARTS-->
            </div><!--TITLE ENDS-->

            <div id="featured"><!--FEATURED AREA STARTS-->

                <div class="featured-image"><!--FEATURED IMAGE STARTS-->
                    <img alt="Featured Image" src="../../media/images/featured_image.png"/>

                </div><!--FEATURED IMAGE ENDS-->

                <div class="featured-text"><!--FEATURED TEXT STARTS-->

                    <h2>Welcome to JA Singapore</h2>
                    <p>Junior Achievement programs help prepare young people for the real world by showing them how to generate wealth and effectively manage it, how to create jobs which make their communities more robust, and how to apply entrepreneurial thinking to the workplace. <a href="http://www.jaworldwide.org/">Read More... </a></p>

                </div><!--FEATURED TEXT ENDS-->

            </div><!--FEATURED AREA ENDS-->

            <?php
            custom_login();
            ?>


            <div id="left-content"><!--RIGHT CONTENT STARTS-->

                <div class="left-top"><!--RIGHT CONTENT BOX TOP-->
                </div><!--RIGHT CONTENT BOX TOP ENDS-->

                <div class="left-middle"><!--RIGHT CONTENT BOX MIDDLE-->

                    <h3>Request Course</h3> <!-- Request event by fill in required fields bellow-->
                    <table>
                        <tr>
                            <td><center>Step 1</center></td>
                            <td><b><center>Step 2</center></b></td>
                            <td><center>Step 3</center></td>
                        </tr>
                        <tr>
                            <td>Select Program -- </td>
                            <td><b> Session date and time -- </b></td>
                            <td>Class Details</td>
                        </tr>
                    </table>
                    <br/>
                    <?php
                    if (!isset($_SESSION['school_id'])) {
                        echo "<br/><br/><br/><br/><br/><center><h3>You don't have permission to view this page<h3><br/>
 Please login to access the page.</center><br/><br/><br/><br/><br/><br/><br/><br/>";
                    } else {
                        ?>
                        <form id="eventRegistration" method ="POST" action="request_event_3.php"  name="frmData" enctype="multipart/form-data" >
                            
                            
                            
                            <table cellpadding="0" cellspacing="0" border="0" class="tablemain" id="admintable">
                                <thead>
                                    <tr>
                                        <th class="tableth">Date</th>
                                        <th class="tableth"> Start Time</th>
                                        <th class="tableth"> End Time</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    for ($i = 0; $i < $no_session; $i++) {
                                        ?>
                                        <tr>
                                            <td> <input type="text" id ="date<?php echo $i ?>" name="date<?php echo $i ?>" class="date required"/></td>
                                            <td> <input type="text" id ="time<?php echo $i ?>" name="time<?php echo $i ?>" class="time required"/></td>
                                            <td> <input type="text" id ="end_time<?php echo $i ?>" name="end_time<?php echo $i ?>" class="time required" /></td>
                                        </tr>

                                        <?php
                                    }
                                    ?>
                                </tbody>
                            </table>
                            <br></br>
                            <table>
                                    <tr>
                                        <td><input type='button'  value="" class="form-back" onclick='history.go(-1)'/></td>
                                        <td><input type="submit" value='' class ="form-next" /></td>
                                    </tr>
                                </table>

                            <input type="hidden" name="program_id" value="<?php echo $program_id ?>"/>
                            <input type="hidden" name="no_class" value="<?php echo $no_class ?>"/>
                            <input type="hidden" name="class_level" value="<?php echo $class_level ?>"/>
                            <input type="hidden" name="no_session" value="<?php echo $no_session ?>"/>

                        </form>
                        <?php
                    }
                    ?>
                </div><!--RIGHT CONTENT BOX MIDDLE ENDS-->
                <div class="left-bottom"><!--RIGHT CONTENT BOX BOTTOM-->
                </div><!--RIGHT CONTENT BOX BOTTOM ENDS-->
            </div><!--RIGHT CONTENT ENDS-->
        </div><!--CONTAINER ENDS-->
        <div id="footer"><!--FOOTER STARTS-->
            <p>Copyright &copy; Junior Achievement Singapore | All Rights Reserved</p>
        </div><!--FOOTER ENDS-->
    </body>
</html>

